package com.jiezuo.demos;

import com.jiezuo.util.FileUtils;
import com.jiezuo.util.PoiWordUtils;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description 图片替换
 * @Author 庞留杰
 * @Date2024/10/22 13:31
 * @Version V1.0
 **/
public class PictureDemoController {

    static String templatePath = System.getProperty("user.dir") + "\\src\\main\\resources\\static\\模版文件.docx";
    static String savePath = System.getProperty("user.dir") + "\\src\\main\\resources\\static\\生成文件.docx";
    static String picturePath = System.getProperty("user.dir") + "\\src\\main\\resources\\static\\image\\印章.png";

    public static void main(String[] args) {
        Map<String, Object> datas = new HashMap<>();
        datas.put("YZ", FileUtils.localToByte(picturePath));
        PoiWordUtils.fillData(templatePath, savePath, datas, false);
    }
}
